package cn.yang.controller;

import cn.yang.domain.Log;
import cn.yang.service.LogService;
import cn.yang.service.TProcessService;
import com.zhentao.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import static cn.hutool.core.date.DateTime.now;

/**
 * @Author: 桑田
 * @Description: TODO
 * @DateTime: 2024/9/27 17:13
 **/
@RestController
@RequestMapping("/process")
public class ProcessController {
    @Autowired
    LogService logService;
    @Autowired
    TProcessService processService;
    @GetMapping("/getById")
    public Result getById(@RequestParam("id")Integer id){
        Log log =new Log();
        log.setName("执行了查询process表");
        log.setTime(now());
        logService.save(log);
        return Result.success(processService.getO(id));
    }
}
